<?php 
require_once ("../plantilla/Guardado/consultarVeh.php");
include (dirname(dirname(__FILE__)).'/plantilla/mpdf/mpdf.php');
include (dirname(dirname(__FILE__)).'/plantilla/Guardado/crearpdf2.php');?>
<html lang="es">
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" type="image/x-icon" href="style/images/favicon.png" />
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
<link rel="stylesheet" type="text/css" href="style/color/red.css" media="all" />
<link rel="stylesheet" type="text/css" media="screen" href="style/css/prettyPhoto.css"  />
<link rel="stylesheet" type="text/css" href="style/type/museo.css" media="all" />
<link rel="stylesheet" type="text/css" href="style/type/ptsans.css" media="all" />
<link rel="stylesheet" type="text/css" href="style/type/charis.css" media="all" />
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/css/ie7.css" media="all" />
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/css/ie8.css" media="all" />
<![endif]-->
<!--[if IE 9]>
<link rel="stylesheet" type="text/css" href="style/css/ie9.css" media="all" />
<![endif]-->
<script type="text/javascript" src="style/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="style/js/jquery.masonry.min.js"></script> 
<script type="text/javascript" src="style/js/ddsmoothmenu.js"></script>
<script type="text/javascript" src="style/js/transify.js"></script>
<script type="text/javascript" src="style/js/jquery.prettyPhoto.js"></script>
<script type="text/javascript" src="style/js/jquery.superbgimage.min.js"></script>
<script type="text/javascript" src="style/js/jquery.slickforms.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
	$('.forms').dcSlickForms();
});
</script>
<script type="text/javascript">
//$(document).ready(function() {
//	
//      var 
//        speed = 1000,   // animation speed
//        $wall = $('#portfolio .items'),
//
//        masonryOptions = {         // initial masonry options
//
//          itemSelector: '.box:not(.invis)',
//          animate: true,
//          animationOptions: {
//            duration: speed,
//            queue: false
//          }
//        };
//		
//		$wall.imagesLoaded(function(){
//			
//			$wall.masonry(masonryOptions);
//			
//			// Create array of filters from link href
//			var arrFilter = [];
//			$('#filtering-nav a').each(function(){
//				fhash = $(this).attr('href').replace('#','');
//				if(fhash != 'all'){
//					arrFilter.push(fhash);
//				}
//			});
//			
//			//  Get the parameter value after the # symbol
//			var url=document.URL.split('#')[1];
//			if(url == undefined){
//				url = 'all';
//			}
//			$('#filtering-nav a.'+url).parent().addClass('active');
//			
////			if(jQuery.inArray(url, arrFilter) > '-1'){
////				// set masonry options animate to false
////				masonryOptions.animate = false;
////				// hide boxes that don't match the filter class
////				$wall.children().not('.'+url).toggleClass('invis').hide();
////			}
////		//	imageSetCss($(".box"));
////			// run masonry again
////			$wall.masonry(masonryOptions);
////		//	imageFadeIn($(".box"));
////		$wall.animate({opacity: 1},1000);
////			
////		});
////		
////		$('#filtering-nav a').click(function(e){
////			var color = $(this).attr('class');
////			filterClass = '.' + color;
////			$('#filtering-nav li').removeClass('active');
////			$(this).parent().addClass('active');
////			
////			if(filterClass=='.all') {
////			  // show all hidden boxes
////			  $wall.children('.invis').toggleClass('invis').fadeIn(speed);
////			} else {
////			  // hide visible boxes 
////			  $wall.children().not(filterClass).not('.invis').toggleClass('invis').fadeOut(speed);
////			  // show hidden boxes
////			  $wall.children(filterClass+'.invis').toggleClass('invis').fadeIn(speed);
////			}
////			$wall.masonry({animate: true});
////			// set hash in URL
////			location.hash = color;
////			e.preventDefault();
//		});
//});
//
//$.fn.imagesLoaded = function(a) {
//	var 
//	b=this.find("img"),
//	c=[],
//	d=this,
//	e=b.length;
//	
//	if(!b.length){
//		a.call(this);
//		return this
//	}
//	b.one("load error",function(){
//		--e===0&&(e=b.length,b.one("load error",function(){
//			--e===0&&a.call(d)}).each(function(){
//				this.src=c.shift()
//			})
//		)}
//	).each(function(){
//		c.push(this.src),this.src=""
//	});
//	return this
//};
  </script> 
</head>

<body>
<!-- Begin Wrapper -->
<div id="wrapper">
  <div id="header">
    <div class="logo opacity"><a href="index.html">AutoGuayana, C.A</a></div>
  </div>
  <div class="clear"></div>
  <!-- Begin Menu -->
  <div id="menu" class="menu opacity">
    <ul>
      <li><a href="index.php">Inicio</a></li>
      <li><a href="catalogo2.php">Catálogo</a></li>
    </ul>
    <br style="clear: left" />
  </div>
  <!-- End Menu -->  

  <!-- Begin Container -->
  <div id="container" class="opacity">
    <h2>Los Mejores Modelos</h2>
    <p>En este espacio te mostramos los diferentes automóviles y accesorios que esperan por ti, descúbre cada una de sus características.</p>
    
    <!-- Begin Portfolio -->
      <div id="portfolio">
        <ul id="filtering-nav">
          <li>Filtrar:</li>
          <li><a class="cat1" href ='catalogo2.php?filter=Autos'> Autos</a>
              </a></li>
          <li><a class="cat2" href="catalogo2.php?filter=Accesorios">Accesorios</a></li>
        </ul>
           <table id= "accesorios" class="table table-bordered" >
           <?php if($filtro == 'Accesorios'){ 
                consultar_acce(); ?>
               <a href="../plantilla/reportes/CatalogoAccesorios.pdf">
                    Ver Completo
                 </a><?php
           } ?>
                   
                   
                </table>
          
           <table id= "autos" class="table table-bordered" >
           <?php 
                if($filtro == 'Autos'){ 
                    //cabecera de la tabla
                    $cuerpo.= "<img src='img/logo.png' /> <tr>
                        <td colspan='9' align='center'>CATALOGO DE VEHICULOS</td></tr><table border=1 >
      
                        <thead>  
                        <tr>
                                
                                <th>ID</th>
                                <th>Modelo</th>
                                <th>Marca</th>
                                <th>N° Puertas</th>
                                <th>N° Cilindros</th>
                                <th>Capacidad</th>
                                <th>Garantia</th>
                                <th>Seguro</th>
                                <th>Fecha de Fab.</th>
                                <th>Lugar de Fab.</th>
                                <th>Precio</th>
                                <th>Peso</th>
                                <th>Color</th>
                        </tr>
                      </thead>"?>
                     
                     <thead>
                        <tr>
                                
                                <th>ID</th>
                                <th>Modelo</th>
                                <th>Marca</th>
                                <th>N° Puertas</th>
                                <th>N° Cilindros</th>
                                <th>Capacidad</th>
                                <th>Garantia</th>
                                <th>Seguro</th>
                                <th>Fecha de Fab.</th>
                                <th>Lugar de Fab.</th>
                                <th>Precio</th>
                                <th>Peso</th>
                                <th>Color</th>
                        </tr>
                        
                </thead>
                <?php
                while ($linea = pg_fetch_array($query, null, PGSQL_ASSOC)) {
                    //Guardando tuplas en el pdf
                    $cuerpo.= "
                        <tr>
                        <td>  ".$linea['idveh']."</td>
                        <td> ".$linea['modelo']."</td>
                        <td> ".$linea['marca']." </td>
                        <td> ".$linea['np']." </td>
                        <td> ".$linea['nc']."</td>
                        <td> ".$linea['cap']." </td>
                        <td> ".$linea['garantia']."</td>
                        <td> ".$linea['seguro']."</td>
                        <td> ".$newDate = date("d-m-Y", strtotime($linea['ffab']))." </td> 
                        <td> ".$linea['lfab']." </td>
                        <td> ".$linea['preciov']."</td>
                        <td> ".$linea['peso']." </td>
                         <td>".$linea['descp']." </td>
                        </tr>";
                    ?>
                               
                    <tr>
                        <td <?php echo $linea['idveh']; ?></td>
                        <td> <?php echo $linea['modelo']; ?> </td>
                        <td> <?php echo $linea['marca']; ?> </td>
                        <td> <?php echo $linea['np']; ?> </td>
                        <td> <?php echo $linea['nc']; ?> </td>
                        <td> <?php echo $linea['cap']; ?> </td>
                        <td> <?php echo $linea['garantia']; ?> </td>
                        <td> <?php echo $linea['seguro']; ?> </td>
                        <td> <?php echo $newDate = date("d-m-Y", strtotime($linea['ffab'])); ?> </td> 
                        <td> <?php echo $linea['lfab']; ?> </td>
                        <td> <?php echo $linea['preciov']; ?> </td>
                        <td> <?php echo $linea['peso']; ?> </td>
                         <td> <?php echo $linea['descp']; ?> </td>
                   </tr>
                <?php }
                 $cuerpo.= "</table>";
                
                crear_pdf($cuerpo,'Catalogo');
                ?>
          </table>
          <a href="../plantilla/reportes/Catalogo.pdf">
            Ver Completo
         </a>
          <?php } ?>
          
<!--        <div class="clear"></div>
        <div class="items">
          <div class="box col5 cat1">
              <a href="portafolio-post.html">
                  <span class="overlay details"></span>
                  <img src="style/images/art/p1.jpg" alt="" />
              </a>
          </div>
          <div class="box col5 cat2">
              <a href="portafolio-post.html">
                  <span class="overlay details"></span>
                  <img src="style/images/art/p2.jpg" alt="" />
              </a>
          </div>
          <div class="box col5 cat1">
              <a href="portafolio-post.html">
                  <span class="overlay details"></span>
                  <img src="style/images/art/p3.jpg" alt="" />
              </a>
          </div>
          <div class="box col5 cat2">
              <a href="portafolio-post.html">
                  <span class="overlay details"></span>
                  <img src="style/images/art/p4.jpg" alt="" />
              </a>
          </div>
          <div class="box col5 cat1">
              <a href="portafolio-post.html">
                  <span class="overlay details"></span>
                  <img src="style/images/art/p5.jpg" alt="" />
              </a>
          </div>
          <div class="box col5 cat2">
              <a href="portafolio-post.html">
                  <span class="overlay details"></span>
                  <img src="style/images/art/p6.jpg" alt="" />
              </a>
          </div>
          <div class="box col5 cat1">
              <a href="portafolio-post.html">
                  <span class="overlay details"></span>
                  <img src="style/images/art/p7.jpg" alt="" />
              </a>
          </div>
          <div class="box col5 cat2">
              <a href="portafolio-post.html">
                  <span class="overlay details"></span>
                  <img src="style/images/art/p8.jpg" alt="" />
              </a>
          </div>
          <div class="box col5 cat1">
              <a href="portafolio-post.html">
                  <span class="overlay details"></span>
                  <img src="style/images/art/p9.jpg" alt="" />
              </a>
          </div>
          <div class="box col5 cat2">
              <a href="portafolio-post.html">
                  <span class="overlay details"></span>
                  <img src="style/images/art/p10.jpg" alt="" />
              </a>
          </div>
          <div class="box col5 cat1">
              <a href="portafolio-post.html">
                  <span class="overlay details"></span>
                  <img src="style/images/art/p11.jpg" alt="" />
              </a>
          </div>
          <div class="box col5 cat2">
              <a href="portafolio-post.html">
                  <span class="overlay details"></span>
                  <img src="style/images/art/p12.jpg" alt="" />
              </a>
          </div>
        </div>-->
        <!-- .wrap --> 
    </div>
    <!-- End Portfolio -->
  </div>
  <!-- End Container -->
  <div id="copyright" class="opacity">
    <p>AutoGuayana, C.A. UCAB-Guayana</p>
  </div>
</div>
<!-- End Wrapper --> 



<script type="text/javascript" src="style/js/scripts.js"></script>

</body>


